<?php 
//echo $javascript->link('jquery');
echo $html->css ( 'tab' );
echo $html->css ( 'jquery-validate/css/screen' );
?>
<script type="text/javascript">

//添加验证
$(document).ready(function() {
	$.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
	$("#f1").validate({
		rules: {
			name:{
			required: true,string:true,stringMinLength:0,stringMaxLength:200
			}
		},
		messages:{maxitem:{required: "请输入"}},
		focusInvalid:false,
		onkeyup:false,
		errorPlacement:function(error, element){error.appendTo("p");}
	});
});
//验证结束

	function getDelStr() {
		var delArr = $("#SalaryareaSalaryareasDelForm :checkbox:checked");
		if(delArr.length==0)
		{
			alert("请选择你要删除的项!");
			return;
		}
		var str = "";
		for(var i=0;i<delArr.length;i++) {
			var del = delArr[i].value;
			str += del;
			str += "/";
		}
		//window.alert(str);
		$("#delStr").val(str);
		//window.alert($("#delStr").val());
		$("#SalaryareaSalaryareasDelForm").submit();
	}

	$(document).ready(function(){
		
		$("#btnajaxAdd").click(function(){
			var n=$("#ho1").val();
			$(".ho").val(n);
			$("#f1").submit();
			});
		$("#btnajaxDel").click(function(){
			var ids="";
			$(":checkbox[checked=true]").each(function(){
				var id=$(this).val();
				ids=ids+id+"/";
				});
			if(ids=="")
			{
				alert("请选择");
			}
			else
			{
				$(".ids").val(ids);
				$("#f2").submit();
			}
		});
		$("#btnajaxEdit").click(function(){
			
			if($(":checkbox[checked=true]").length==0)
			{
				alert("请选择");
			}
			else if($(":checkbox[checked=true]").length>1)
			{
				alert("请选择1个");
			}
			else
			{
				id=$(":checkbox[checked=true]").val();
				$(".id3").val(id);
				$("#f3").submit();
			}	
		
			});
});
</script>

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Channelmanage');//一级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('ChannelmanageType',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<form action="<?php echo ROOT_WEB_PATH; ?>/channelmanages/addchanneltype" method="post" id="f1">
<input type="hidden" name="name" class="ho"></input>
</form>
<form action="<?php echo ROOT_WEB_PATH; ?>/channelmanages/delSomechanneltype" id="f2" method="post">
<input type="hidden" name="ids" class="ids"></input>
</form>
<form action="<?php echo ROOT_WEB_PATH; ?>/channelmanages/editchanneltype" id="f3" method="post">
<input type="hidden" name="id" class="id3"></input>
</form>
 <!-- 当前位置-->
<?php  echo $form->create('del',array('action'=>'addholidaytype','type'=> 'post'));?>
<?php  echo $form->hidden('delStr',array('name'=>'salaryareaid','id'=>'delStr'));?>

 <!-- 渠道类型列表 -->
<div id="nav1" style="width:65%">
<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th width="70px"><?php echo __('Selected');?></th>
		<th ><?php echo __('ChannelmanageType');?></th>
		
	</tr>
	<!-- Here's where we loop through our $Notes array, printing out post info --> 
	
	<?php 
	foreach ($result as $row): 
	?>
		<tr class=normal onmouseover='this.className= "over " '
			 onmouseup='this.className= "over " '
			 onmouseout='this.className= "normal " '>
			<td>
<!-- 批量删除选择 -->				
				<?php echo $form->checkbox($row['Channeltype']['id'], array('value' => $row['Channeltype']['id'],'class'=>'che'));?>
			</td>
			<td><?php echo $row['Channeltype']['name']; ?></td>
			
		</tr> 
	<?php endforeach; ?>
</table>
</div>
<!-- 假期类型列表-->
<div id="nav1" style="width:28%">

<fieldset><legend><?php __('ChannelmanageType');?></legend>
		<table width="98%" cellspacing="0" cellpadding="0" border="0" >
			<tr>
				<td width="80px"><span id="Label3" class="searchcharstyle"><?php __('ChannelmanageType'); ?></span>
				</td>
				<td >
				
				<input type="text" name="name" class="TextBoxL txtOut" id="ho1"></input><p id="p"></p>
				 </td>
				   <td width="20px">
					<a><?php echo $html->image('add.gif', array('alt' =>  __('Add', true),'border'=>'0','id'=>'btnajaxAdd'));?> </a>
					 <!--添加 -->
				</td>
				<td width="20px">
				<a><?php echo $html->image('edit.gif', array('alt' =>  __('Edit', true),'border'=>'0','id'=>'btnajaxEdit'));?> </a><!--
					 修改 --></td>
				<td width="20px">
				<a><?php echo $html->image('delete.gif', array('alt' =>  __('Delete', true),'border'=>'0','id'=>'btnajaxDel'));?> </a>
					 <!--删除 --></td>
			</tr>
			</table>
</fieldset>
</div>
<?php echo $form->end();?>

